package com.example.hm_dtfkz.config;

import android.app.Activity;

import com.android.base.util.DQLog;
import com.android.base.util.Mmkv;
import com.android.base.util.ToastUtil;
import com.dq.ad.ADUtils;
import com.hx.update.UpdateInfo;

/**
 * Author : Z-JC
 * Date : 2021/11/5
 * Description :
 */
public class AppConfig {
    public static String UMENG_KEY = "";
    public static String HX_APP_ID = "";
    public static String CH_ID = "";
    public static String CP_ID = "";
    public static int CH_TYPE_ID = 1;
//    public static String TT_APP_ID = "";
    public static String APP_CODE = "";
    public static String PARAMS = "";
    public static String QQ_GROUP = "640089641";
    public static String QQ_GROUP_KEY = "sufFiFgflyEhgPiilXT_D4BGhFU6Ri0E";
    public static String INVITE_CODE = "";
    public static String PUSH_CODE = "";
    public static String WX_CODE = "";
    public static int TD_BANNED = 0;
    public static String TD_BANNED_MSG = "";

    public static boolean FROM_WX = false;

    public static int[] GEAR_WITHDRAWAL = {30, 60};  //每日提现档位设置

    public static UpdateInfo updateInfo; // 更新包信息

    /**
     * 每日惊喜红包弹出次数
     */
    public static final int SURPRISE_TIMES_MAX = 3;
    /**
     * 每日最多气泡红包领取次数
     */
    public static final int BUBBLE_TIMES_MAX = 6;
    /**
     * 每日最多看视频补充红包次数
     */
    public static final int COIN_TIMES_MAX = 6;

    public static volatile boolean isGoonMakeMoney;  //继续赚钱

    /**
     * 存钱罐状态 0不可领取 1可领取
     */
    public static int saveCashState;

    /**
     * 当前正在提现的任务
     */
    public static int tiXianPos;

    /**
     * 位置权限 0关闭 1开启
     */
    public static int localPermission;

    /**
     * 当前体力
     */
    public static int hp = 30;

    /**
     * 满体力
     */
    public static int FHP = 30;

    /**
     * 恢复1点体力所需时间
     */
    public static int ahp = 300;

    /**
     * 恢复一点体力总时间
     */
    public static int UHP = 300;

    /**
     * 是否绑定QQ号 0 未绑定 1已绑定
     */
    public static int hasQQ = 0;

    /**
     * 提现前弹加入qq窗的开关是否打开 0 关闭 1开启
     */
    public static int hasQQStatus = 0;





    /**
     * 查看是否同意隐私政策
     *
     * @return
     */
    public static boolean getAgreed() {
        return Mmkv.getBoolean("agreed");
    }

    /**
     * 设置是否同意隐私政策
     *
     * @param install
     */
    public static void setAgreed(boolean install) {
        Mmkv.setBoolean("agreed", install);
    }

    /**
     * 查看是否申请过权限
     *
     * @return
     */
    public static boolean getRequestPermission() {
        return Mmkv.getBoolean("request_permission");
    }

    /**
     * 设置是否申请过权限
     *
     * @param request
     */
    public static void setRequestPermission(boolean request) {
        Mmkv.setBoolean("request_permission", request);
    }

    /**
     * 查看是否申请过位置权限
     *
     * @return
     */
    public static boolean getRequestPosPermission() {
        return Mmkv.getBoolean("request_pos_permission");
    }

    /**
     * 设置是否申请过位置权限
     *
     * @param request
     */
    public static void setRequestPosPermission(boolean request) {
        Mmkv.setBoolean("request_pos_permission", request);
    }

    /**
     * 设置游戏音乐
     */
    public static void setGameSound(boolean value) {
        Mmkv.setBoolean("game_sound", value);
    }

    /**
     * 获取游戏音乐状态
     *
     * @return
     */
    public static boolean getGameSound() {
        return Mmkv.getBoolean("game_sound");
    }

    /**
     * 设置背景音乐
     */
    public static void setBackMusic(boolean value) {
        Mmkv.setBoolean("back_music", value);
    }

    /**
     * 获取背景音乐状态
     *
     * @return
     */
    public static boolean getBackMusic() {
        return Mmkv.getBoolean("back_music");
    }

    /**
     * 保存已经累计登陆的天数
     *
     * @param dayNumber
     */
    public static void setLoginDayNumber(int dayNumber) {
        Mmkv.setInteger("login_day_number", dayNumber);
    }

    /**
     * 获取已经累计登陆的天数
     *
     * @return
     */
    public static int getLoginDayNumber() {
        return Mmkv.getInteger("login_day_number");
    }

    /**
     * 设置当天在线时长
     *
     * @param time
     * @return
     */
    public static void setDayOnLineTime(int time) {
        Mmkv.setInteger("day_online_time", time);
    }

    /**
     * 获取当天在线时长
     *
     * @return
     */
    public static int getDayOnLineTime() {
        return Mmkv.getInteger("day_online_time");
    }

    /**
     * 保存当天答对次数
     *
     * @param dayAnswerNumber
     */
    public static void setDayAnswerNumber(int dayAnswerNumber) {
        Mmkv.setInteger("day_answer_number", dayAnswerNumber);
    }

    /**
     * 获取当天答对次数
     *
     * @return
     */
    public static int getDayAnswerNumber() {
        return Mmkv.getInteger("day_answer_number");
    }

    /**
     * 是否已重置每日在线领红包和俸禄次数
     *
     * @param value
     */
    public static void setResetOnlineState(boolean value) {
        Mmkv.setBoolean("reset_online_state", value);
    }

    /**
     * 是否已重置每日在线领红包和俸禄次数
     */
    public static boolean getResetOnlineState() {
        return Mmkv.getBoolean("reset_online_state");
    }

    /**
     * 保存是否查看过如何新人提现
     *
     * @param balanceState
     */
    public static void setMeBalanceState(boolean balanceState) {
        Mmkv.setBoolean("me_balance_state", balanceState);
    }

    /**
     * 查看是否查看过如何新人提现
     *
     * @return
     */
    public static boolean getMeBalanceState() {
        return Mmkv.getBoolean("me_balance_state");
    }

    /**
     * 保存当前答题的类型
     *
     * @param answerType
     */
    public static void setAnswerType(int answerType) {
        Mmkv.setInteger("answer_type", answerType);
    }

    /**
     * 获取当前答题的类型
     *
     * @return
     */
    public static int getAnswerType() {
        return Mmkv.getInteger("answer_type");
    }

    /**
     * 保存存钱罐金额
     *
     * @param money 金额
     */
    public static void setTotalPiggy(long money) {
        Mmkv.setLong("total_piggy", money);
    }

    /**
     * 获取存钱罐金额
     *
     * @return 金额
     */
    public static long getTotalPiggy() {
        return Mmkv.getLong("total_piggy");
    }

    /**
     * 保存提取现金次数
     *
     * @param times 提取现金次数
     */
    public static void setExtractTimes(int times) {
        Mmkv.setInteger("extract_times", times);
    }

    /**
     * 获取提取现金次数
     *
     * @return 提取现金次数
     */
    public static int getExtractTimes() {
        return Mmkv.getInteger("extract_times");
    }

    /**
     * 保存是否主动弹出过新人提现对话框
     *
     * @param isShow 是
     */
    public static void setShowNewComer(boolean isShow) {
        Mmkv.setBoolean("show_newcomer", isShow);
    }

    /**
     * 是否主动弹出过新人提现对话框
     *
     * @return 是否主动弹出过新人提现对话框
     */
    public static boolean isShowNewComer() {
        return Mmkv.getBoolean("show_newcomer");
    }

    /**
     * 保存是否主动弹出过每日提现对话框
     *
     * @param isShow 是
     */
    public static void setShowDaily1(boolean isShow) {
        Mmkv.setBoolean("show_daily1", isShow);
    }

    /**
     * 是否主动弹出过每日提现对话框
     *
     * @return 是否主动弹出过每日提现对话框
     */
    public static boolean isShowDaily1() {
        return Mmkv.getBoolean("show_daily1");
    }

    /**
     * 保存是否主动弹出过每日提现对话框
     *
     * @param isShow 是
     */
    public static void setShowDaily2(boolean isShow) {
        Mmkv.setBoolean("show_daily2", isShow);
    }

    /**
     * 是否主动弹出过每日提现对话框
     *
     * @return 是否主动弹出过每日提现对话框
     */
    public static boolean isShowDaily2() {
        return Mmkv.getBoolean("show_daily2");
    }

    /**
     * 保存当前摇钱树金额
     *
     * @param cashCow 摇钱树金额
     */
    public static void setCashCow(double cashCow) {
        Mmkv.setDouble("cash_cow", cashCow);
    }

    /**
     * 获取当前摇钱树金额
     *
     * @return 摇钱树金额
     */
    public static double getCashCow() {
        return Mmkv.getDouble("cash_cow");
    }

    /**
     * 保存今日提现人数
     *
     * @param people 今日提现人数
     */
    public static void setTodayPeople(int people) {
        Mmkv.setInteger("today_people", people);
    }

    /**
     * 获取今日提现人数
     *
     * @return 今日提现人数
     */
    public static int getTodayPeople() {
        return Mmkv.getInteger("today_people");
    }

    /**
     * 是否完成引导流程
     *
     * @return 是否主动弹出过每日提现对话框
     */
    public static boolean isShowGuideComplete() {
        return Mmkv.getBoolean("show_guide_complete");
    }

    /**
     * 保存是否完成引导流程
     *
     * @param isComplete 是否完成
     */
    public static void setShowGuideComplete(boolean isComplete) {
        Mmkv.setBoolean("show_guide_complete", isComplete);
    }

    /**
     * 设置剩余提现次数
     *
     * @param times 提现次数
     */
    public static void setRemainWithdrawalTimes(int times) {
        Mmkv.setInteger("remain_withdrawal_times", times);
    }

    /**
     * 获取剩余提现次数
     *
     * @return 提现次数
     */
    public static int getRemainWithdrawalTimes() {
        return Mmkv.getInteger("remain_withdrawal_times");
    }

    public static void removeMmkvKey(String key) {
        Mmkv.removeKey(key);
    }

    public static boolean hasNoAd() {
        DQLog.e("canShowVideoAd: " + ADUtils.canShowVideoAd);
        return !ADUtils.canShowVideoAd;
    }

    public static void showNoAdToast(Activity activity) {
        ToastUtil.showLongToastCenter(activity, "今日已无广告，请明日再来");
    }




}